<template>
  <div>
    <div class="myart1">
      <article-item v-for="a in allData.data" :key="a.comment_id" v-bind="a"  @call-get-comment="load"/>
      <el-empty
          v-if="allData.data.length == 0"
          :image-size="250"
          description="暂未发表任何书评"
      ></el-empty>
    </div>
  </div>
</template>

<script>
import ArticleItem from '../admin/ArticleItem.vue';
export default {
  components: { ArticleItem },
  name: "myarticle",
  data() {
    return {
      allData:[],
      avatar: String,
      account: String,
      age: String,
      email: String,
      mobilePhoneNumber: String,
      area: String,
      createDate: String,
      nickname: String,
      sex: String,
      work: String,
      hobby: String,
      design: String,
    };
  },
  mounted() {
    this.load();
  },
  methods: {
    load(){
      this.$axios
          .post('/getComments', {
            authorId: window.localStorage.getItem('userId'),
          })
          .then(res=>{
            this.allData = res
          })
    }
  },
};
</script>

<style scoped>
.img {
  width: 80px;
  height: 80px;
}
.el-card {
  margin-bottom: 30px;
}
</style>